//Implementation file - Character.cpp
//
//

#include <iostream>
#include "Character.h"

using namespace std;

Character::Character()
{
	name = "unknown";

	strength = 1;
	dexterity = 1;
	constitution = 1;
	wisdom = 1;
	charisma = 1;
	baseAttack = 0;

	maxHitPoints = 1;
	hitPoints = 1;

	gold = 0;

	weapon.setName("Fists");
	weapon.setMinimumDamage(1);
	weapon.setMaximumDamage(3);
	weapon.setCriticalMultiplier(2);
	weapon.setCriticalMinimum(20);

	armor.setName("None");
	armor.setBonus(0);
	armor.setPenalty(0);
	armor.setMaxDexterity(10);

}
/*********************** STRENGTH FUNCTIONS ***************************************/
int Character::getStr() {
	return strength;
}
int Character::getStrMod() {
	return ((strength / 2) - 5);
}
void Character::setStr(int str) {
	if (str > 0) {
		strength = str;
	}
}
/*********************** DEXTERITY FUNCTIONS **************************************/
int Character::getDex() {
	return dexterity;
}
int Character::getDexMod() {
	return ((dexterity / 2) - 5);
}
void Character::setDex(int dex) {
	if (dex > 0) {
		dexterity = dex;
	}
}
/*********************** CONSTITUTION FUNCTIONS ***********************************/
int Character::getCon() {
	return constitution;
}
int Character::getConMod() {
	return ((constitution / 2) - 5);
}
void Character::setCon(int con) {
	if (con > 0){
		constitution = con;
	}
}
/*********************** WIDSON FUNCTIONS *****************************************/
int Character::getWis() {
	return wisdom;
}
int Character::getWisMod() {
	return ((wisdom / 2) - 5);
}
void Character::setWis(int wis) {
	if (wis > 0){
		wisdom = wis;
	}
}
/*********************** CHARISMA FUNCTIONS ***************************************/
int Character::getCha() {
	return charisma;
}
int Character::getChaMod() {
	return ((charisma / 2) - 5);
}
void Character::setCha(int cha) {
	if (cha > 0){
		charisma = cha;
	}
}
/*********************** NAME FUNCTIONS *******************************************/
string Character::getName() {
	return name;
}
void Character::setName(string newName) {
	name = newName;
}
/*********************** WEAPON FUNCTIONS *****************************************/
Weapon& Character::getWeapon()
{
	return weapon;   //***I think that this is what he means*****
}
void Character::setWeapon(Weapon newWeapon) {
	weapon = newWeapon; //**Assuming the "=" has been overloaded****
}
/*********************** ARMOR FUNCTIONS ******************************************/
Armor& Character::getArmor()
{
	return armor;
}
void Character::setArmor(Armor newArmor) {
	armor = newArmor;
}
int Character::getArmorClass() {
	return (10 + getDexMod() + armor.getBonus());
}
/*********************** ATTACK FUNCTIONS******************************************/
int Character::getBaseAttack() {
	return baseAttack;
}
void Character::setBaseAttack(int base) {
	baseAttack = base;
}
/*********************** MAX HIT POINTS FUNCTIONS ********************************/
int Character::getMaxHitPoints() {
	return maxHitPoints;
}
void Character::setMaxHitPoints(int max) {
	maxHitPoints = max;
}
/*********************** HIT POINTS FUNCTIONS *************************************/
int Character::getHitPoints() {
	return hitPoints;
}
void Character::setHitPoints(int hp) {
	hitPoints = hp;
}
/*********************** GOLD FUNCTIONS *******************************************/
int Character::getGold() {
	return gold;
}
void Character::setGold(int newGold) {
	gold = newGold;
}
/*********************** DISPLAY CHARACTER*****************************************/
void Character::display() {
	
	cout << endl << endl;
	cout << "\t\t" << name << endl << endl;

	cout << "\tAttributes:" << endl;
	cout << "Strength = " << strength << endl;
	cout << "Dexterity = " << dexterity << endl;
	cout << "Constitution = " << constitution << endl;
	cout << "Wisdom = " << wisdom << endl;
	cout << "Charisma = " << charisma << endl;
	cout << "Base Attack Strength = " << baseAttack << endl << endl;

	cout << "\tWeapon:" << endl;
	cout << "Name = " << weapon.getName() << endl;
	cout << "Minimum Damage = " << weapon.getMinimumDamage() << endl;
	cout << "Maximum Damage = " << weapon.getMaximumDamage() << endl;
	cout << "Minimum Roll for Critical Hit = " << weapon.getCriticalMinimum() << endl;
	cout << "Critical Hit Multiplier = " << weapon.getCriticalMultiplier() << endl << endl;

	cout << "\tArmor:" << endl;
	cout << "Name = " << armor.getName() << endl;
	cout << "HP Bonus = " << armor.getBonus() << endl;
	cout << "Dexterity Penalty = " << armor.getPenalty() << endl;
	cout << "Maximum Dexterity = " << armor.getMaxDexterity() << endl << endl;

	cout << "Gold = " << gold << endl << endl;
}
